package com.example.enjoylearning.api

import com.example.enjoylearning.model.BaseRequestBean
import com.example.enjoylearning.model.LoginBen
import io.reactivex.Observable
import retrofit2.http.Field
import retrofit2.http.FormUrlEncoded
import retrofit2.http.POST

/**
 * @Author ninetailedfox
 * @Data 2022/10/25 8:52 上午
 * @ClassName WanAndroidApi
 *
 * api 网址 https://wanandroid.com/blog/show/2
 **/
interface WanAndroidApi{

    @POST("user/login")
    @FormUrlEncoded
    fun loginWanAndroid(
        @Field("username") username:String,
        @Field("password") password:String
    ): Observable<BaseRequestBean<LoginBen>>

    @POST("user/register")
    @FormUrlEncoded
    fun registerWanAndroid(
        @Field("username") username:String,
        @Field("password") password:String,
        @Field("repassword") repassword:String
    ): Observable<BaseRequestBean<LoginBen>>
}